(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Children's Library | Biodiversity Heritage Library | Additional Collections
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "Super Expander (1982)(Commodore)[a]"

/ 



Elargissement de la capacitede memoire 
vive a 3K RAM 

Tracage des graphiques a haute resolution 
Mode de composition muslcale 
Commandes couleur/peinture 

Definition facile des touches de fonctions 
Manuel complet Indus 



3K RAM memory expansion 
High resolution graphics plotting 
Musicwriting mode 
Colour/paint commands 

Eaoy function key definition 
Comprehensive manual included 



VIC1211A 



Programs created with Super Expander's special statements will 
not work on a machine without the Super Expander plugged in. 

Finally, the extra 3K memory expansion is provided automatically 
when you plug in the Super Expander . . . you will see the screen 
come up with approximately 3000 extra bytes of memory when 
you turn it on. 



GETTING STARTED 

1. Turn on your television set. 

2. Turn your VtC 20 off 

3. insert the cartridge. 

4. Turn the VIC 20 on. 

5. Your Super Expander is now activated and you may write 
programs in BASIC using the special commands, statements 
and functions listed below. 



II. USING SUPER EXPANDERGRAPHICS 

Afew special notes are in orderbefore you begin working through 
the manual. To begin with r it should be noted that for purposes of 
graphics plotting, the Super Expander cartridge divides the 
screen area into 1 024, by 1 024 coordinates. For example, if you 
ty pe POI NT 1 ,5 1 2,5 1 2 you will d raw a point at the very middle of 
the screen. These are "pseudo-coordinates" which means the 
VIC accepts inputs based on 1024x1024 dot coordinates and 
scales the plotting down to the VIC's actual screen size/resolution, 

A full range of graphic instructions is automatically added to your 
VIC's standard BASIC instruction set when you plug in the Super 
Expander cartridge. These instructions are listed and explained 
below. 



NOTE: WHEN WORKING WITH GRAPHICS THERE ARE TWO 
IMPORTANT PARAMETERS WHICH YOU MUST INCLUDE AT 

THE BEGINNING OFYOURPROGRAM.Thesesetupthegraphic 
screen so you can plot, include characters mixed with graphics, 
etc. The two graphic commands you should begin your program 
with are: GRAPHIC and COLOR. GRAPHIC sets the VIC in the 
"GRAPHIC MODE" you want to use, and "COLOR" specifies 1 the 
colors you will be working with. 



INSTRUCTION 



GRAPHIC 

SCNCLR 

COLOR 

REGION 

DRAW 

POINT 

CIRCLE 

PAINT 

CHAR 

SOUND 



Prepares the screen for graphics 

Clears a graphic screen 

Sefect screen, border, character, and auxiliary 

colors 

Select character color 

Plots a iine between two points 

Plots a single point 

Draw a circle, ellipse, or arc 

Fill in an enclosed area in a color 

Puts text on the graphic screen 

Set 4 tones and volume all at once 



FUNCTION 

RGR(x) 

RCOLR(x) 

RDOT(x,y) 

RPOT(x) 

RPEN(x) 

RJOY(x) 

RSND(x) 



RETURN VALUE 

Current graphic mode 

The value in a color register 

The color of a point on the screen 

The position of the game paddle 

The position of the light pen 

The position of the joystick 

The value in a sound register 



GRAPHIC n 

This sets up the graphic screen and activates the graphics 
instruction set There are 5 different GRAPHIC modes, which are 
activated by typing GRAPHIC and the number, as an instruction in 
your program. 

Example: 

10 GRAPHIC 2 

20 COLOR 1,2,3,4 

Type RUN and hit RETURN. 



Value of n 


1 
2 
3 
4 



Mode 

Text mode (normal) 
Mutti-color mode 
High resolution mode 
Mixed muiti and high-res 
Return to text mode 



Mode is the VIC T s normal text mode. Once the mode has been 
changed, the GRAPHIC 4 statement is used to return to this 
mode. 

In mode 1 , there are 80 points across a line, and 1 60 lines. Each 
point is drawn in one of the 4 color registers: screen color, border 
color, character color, or auxiliary color, A point placed in the 
screen color is invisible, since it is the same as the background; 
this can be used to erase other points. Points drawn in either the 
screen, border, or auxiliary colors will change instantly when 
these colors are changed. The character color is associated with 
each specific 4 dot by 1 6 dot space of the screen. This means that 
if adot is plotted in that space in a character color, all other points 
in that space that were drawn in the character color will change to 
the new character color 



i 



In m ode 2, there are 1 60 points across a I i ne, and 1 60 lines. The 
points are half as wide as in mode 1 h and therefore give twice as 
fine resolution to the screen. However, the color resolution is 
more limited. Dots can be plotted only in a character color. Within 
each specific space on the screen^ which is an 8 by 8 dot area, 
there can be only one charactercolor, so you can only have dots in 
that color displayed on the screen. 

Mode 3 is a mixture of modes 1 and 2. When the character color is 
less than 8, the plotting is done in high resolution. When the 
character color is greater than 7, multi-color mode is in effect 

Mode 4 returns the screen to text mode from a graphic mode. 
WARNING: if the VfC was already in text mode, this will mess up 
the VIC until you turn it off and then on again. 



SCNCLR 

This statement clears the entire graphic screen, it may be typed 
directiy or included in a program line. 



COLOR sc, bo,ch, au 

This sets up the 4 different color registers. The variables here 
have these limits: 

sc = to 1 5 

bo = to 7 

ch = to 7 normal, 8 to 15 multi-color 

au = to 15 



The colors are: 







black 


1 


white 


2 


red 


3 


cyan 


4 


purple 


5 


green 


6 


blue 


7 


yellow 


a 


orange 


9 


light orange 


10 


pink 


11 


light cyan 


12 


light purple 


13 


light green 


14 


light blue 


15 


light yellow 




NOTE: in GRAPHIC 3 mode, character color numbers greater 
than ? set multi-color mode. In this case f the actual character 
in that space is the color number minus 8. 

EXAMPLE: COLOR U 2, 3, 4 



REGION c 

This works like the COLOR statement except that onfy the 

character color is affected. 

EXAMPLE: REGION 7 



• TO xn, 



DRAW c, x1, y1 TO x2, y2 [TO x3, y3 . 

ynj 

or 

DRAWcTOxl, y1 [.„] 



This allows you to draw lines in the screen. The variable c is the 
color of the line, on the following chart: 



High*res 






screen 


1 


character 


2 


character 


3 


character 



Multi-color 

screen 
border 
character 
auxiliary 



The x and y variables are the coord [nates of the end-points of the 
line. The values of X and Y can be from to 1 023. An X value of is 
the left edge of the screen, and X^1 023 is the right edge, and the 
Y values determine the up-and-down position. The values from 
to 1 023 are scaled down to the actual (1 60 by 1 60 or 80 by 1 60) 
size of the screen. 



EXAMPLE 1: DRAW 1 r 0, 0TO 100, 100 
EXAMPLE2:DRAW1,0,0TO0,100TO100,100TO100,0TO0,0 



EXAMPLE 1 



EXAMPLE 2 





POINT c, x, y 

or 

POINT c, x1,y1,x2, y2, -, xn, yn 

This sets a point or points on the screen in the specified color. The 
points are given in the & to 1023 form. 

EXAMPLE 1 : POINT 1 , 500, 500 

EXAMPLE 2: POINT 2, S00 F 500 T 600, 600, 700, 700 



CIRCLE c ? x, y, rx, ry [,as,ae] 

Where: c is the color register (see chart in DRAW statement) in 
which the circle is drawn 

x and y are the coordinates of the center of the circle 
rx and ry are width and height of the circle 
as and ae are the optional starting and ending angles of 
the arc, in gradians {0 to 100 degrees in a full circle) 



e 



EXAMPLE 1: CIRCLE 1, 511,511, 300,400 
EXAMPLE 2: CIRCLE 1, 200, 900, 100 r 100 
EXAMPLE 3: CIRCLE 2, 500, 600, 200, 300, 10, 70 

EXAMPLE 1 




EXAMPLE 2 



EXAMPLE 3 





PAINT c, x, y 

This paintsan enclosedarea in acolor.cis thecolorregister, and x 
and y are any point within the area to be painted. Each area can 
only be painted once. Because of the color limitations of some 
GRAPHIC modes, some nearby shapes may be distorted by this 
operation. If an area is bounded by multi-color mode areas, it must 
be PAINTed in the multi-color mode. 

EXAMPLE: 10 GRAPHIC 1 

20 COLOR 1,7,0, 10 

30 CIRCLE 2, 511, 511, 200, 300 

40 PAINT 3, 51 1,511 

50 PAiNT 1,511,0 



9 



CHAR ro, co, "text" 

This will put normal text on a graphic screen. The ro and co 
variables are the row and column on which the text is to appear. 
The text can be any string variable ortext inside quote marks. Text 
should only be displayed when in the high-resolution mode, orthe 
mixed mode, but never in multi-color mode. 

EXAMPLE: CHAR 1,1, "HELLO THERE" 



SOUND s1, s2, S3, s4, v 

This sets ah 4 sound "speakers" and the volume control all at 
once. The S1 value is put into register 1 . If its value is less than 1 28, 
no sound will playfrom thatspeaker. The volume can rangef rom 
(off) to 15. This lets you create multi-speaker sound effects. 

EXAMPLE: SOUND 225, 225 T 225, 0, 15 



RGR(x) 

This function reads the graphic mode that was set with the 
GRAPHIC command. The value of x can be from to 255 t and 
doesn't effect the result. 

EXAMPLE: X= RGR(0) 



RCOLR(x) 

This reads the color from any of the 4 reg isters, depend! ng on the 



value of x on the following table: 



COLOR REGISTER 






screen color 


1 


border color 


2 


character color 


3 


auxiliary color 



EXAMPLE: X = RCOLR(2) 



RDOT(x, y) 

This reads the color value of a dot on the screen. The values of x 
and y are the coordinates of the point, and the color value 
returned is the register of the color on that space. 

EXAMPLE: X= RDOT(511, 511) 



RPOT(x) 

This reads the value of the paddle. If x = 0, paddle X is read, and if 
x = 1, paddle Y is read. 



EXAMPLE: 10 GRAPH IC2:COLOR11, 6,6,6, 

20 X=RPQT(0):Y=RPOT(1):J=RJOY(Gf) 
30 IFJ=12THEN:SCNCLR 
40 IFJ=4THEN:REGION2 
50 IFJ=STHEN:REGtON6 
60 PGINT2 r XM r Y*4:GOTO20 



RPEN(x) 

This reads the screen coordinate of the light pen. If x=0, the X 
coordinate is returned, and if x=1, the Y coordinate. 

EXAMPLE: X= RPEN(0) 



RJOY(x) 

This reads the value of the joystick The x variable must be 
between and 255, and has no effect on the outcome. 

EXAMPLE: 10 GRAPHIC2:COLOR1 1 ,6,6,6,:X=1 70:Y=170 

20 J=RJOY(0) 

30 X=X+((JAND4)=4)^((JAND8)=8) 

40 Y=Y+((JAND1)=)-({JAND2H2) 

50 POtNT3 1 X*3,Y*3:IFJ=1 28THEN:3CNCLR 

60 GOTO20 



RSND(x) 

This reads the value of any of the sound registers, depending on 
the value of x from this chart: 

x sound register 



1 
2 
3 
4 
5 



sound 1 
sound 2 
sound 3 
sound 4 
volume 



WRITING SUPER EXPANDER MUSIC 



The Super Expander's music writing mode lets you play notes 
directly by typing on the keyboard, or, more important, by using 
the PRINT statement in your BASIC PROGRAMS. It is "interrupt 
driven", which lets music play while the program proceeds with 
other tasks. It is designed primarily for playing of music, as 
opposed to sound effects, and makes writing programs with 
chords much easier. 

Music mode is entered by holding down theCTRL key and hitting 
the left arrow (-*-). When you type this in quotes in a program a 
"reverse f ' shou Id appear. This is a special symbol that shows you 
where music mode is included in your program. Now any key you 
type will be interpreted by the music package, until the RETURN 
key is hit. Here are the characters recognized by music mode: 



Character 

P 
Q 
V 
S 



Effect 

Screen echo on 
Screen echo off 
Volume selection 
Sound register selection 



O (the letter O, not the number) Octave selection 
7 Tempo selection 

A Rest for 1 beat 

C P D, E, F, G, A, B Play note 

# Play the next note sharp 

$ Play the next note flat 

RETURN Ends music mode 

When PRINTING strings of these characters, the semicolon (;} 
can be used to prevent the RETURN character from ending music 
mode. 



The screen echo is normally off. Any characters recognized by the 
music package are not displayed on the screen. However, when 
the echo is turned on, they appear normally. 

Some of the letters recognized by music mode must be followed 
by a single digit. Here is a table of these letters and their 
associated numbers: 



Letter 


Numbers 


Value of numbers 


V 


0to9 


Is quietest, 9 loudest 


S 


1 to 4 


Speaker no. 


O 


1 to 3 


1 is fowet, 3 is highest 


T 


to 9 


Tempo 


The tempo 


is selected according to this chart: 


Tempo 


Beats per 


Duration of note 


number 


minute 


times 1/60 second 





900 


4 


1 


600 


6 


2 


450 


8 


3 


300 


12 


4 


225 


16 


5 


150 


24 


6 


112.5 


32 


7 


56.25 


64 


a 


28. 


128 


9 


14. 


255 



Each sound register has 3 complete octaves in its range. However 
since register 2 is one octave higher than register 1, the three 
octaves are different. When playing notes in different sound 
registers, be sure that the octaves used are chosen correctly. 



Here are some examples of strings that play music (the reversed f 
symbol means hold down the CTRL Key and type the left arrow 
key at the top left corner of the keyboard). 

10PR!NT J[ ALLTHESAMENOTEEIBQ[O T7V9S103CS2C 

S3 01 C" 

20 PRINT "SCALE ICTRD W=\ T3 V9 S2 01 CDEFGAB 02 

BDEFGAB 03 CDEF GAB" 

30 PRINT "CHORDS ICTRDR=1 T5 V9 S1 03 C S2 E S3 01 G"; 
40 PRINT "S1 03 D S2 02 #F S3 01 B T '; 
50 PRINT "S1 03 E S2 02 A S3 02 C" 

IV. PROGRAMMABLE FUNCTION KEYS 

There are 8 functions that can be accessed with thefunction keys 
along with the SHIFT key. These are pre-assigned to the following: 



Key 



Text 



n 


GRAPHIC 


n 


COLOR 


f3 


DRAW 


14 


SOUND 


ts 


CIRCLE 


f6 


RUN + RETURN 


f7 


POINT 


fa 


LIST + RETURN 



Any time you hit these keys, the characters with which they are 
programmed enter the input buffer exactly as if you had typed 
them in yourself. Each key can be programmed with up to 128 
characters, using the KEY command. 



KEY 

or 

KEY n, "string" 

The word KEY ail by itself .makes the VIC display a list of all 8 func- 
tion keys and their current value. This is formatted on the screen so 
the contents of the strings can be edited by moving the cursor up to 
the string, making the desired change, and hitting RETURN, just 
like editing a program. You can change any key in the KEY MENU by 
changing the information inside the quotation marks and hitting 
return or by typing the KEY command using the format shown in the 
example below. 

When followed by a number, this command changes the string 
value of the key to the new value. This can be up to 128 
characters, including cursor and color controls, the RETURN 
(CHR$(13)) 5 or any other character. The keys can be changed 
under program control as well. 

EXAMPLE: KEY 1 5 'ISN'T IT AMAZING?" 



V. 3K MEMORY EXPANSION 

When the 3K cartridge is used to expand the V1C-20, the BASIC 
program area is changed so it starts at location 1024 ($0400). 

Notethat with the 3K cartridge plugged in, on lyon-board memory 
(4096-81 91 or $ 1 000-1 FFF) can be used as VIC screen and Ir- 
resolution graphics areas. 



SUPEREXPANDER 

PROGRAM 

EXAMPLES 

PROGRAM 1 



5 REW 'fTUG PLOT EEKU 

£C=INT{RND(1)*16} iCH=INT(RND(l)*R}ilFSC=aiTHRNJ5 

CQLQRS<: r £C,CH, 1 

Aft=RMM])*10fl+Lflp 



11 
15 

H 

5ft 
6 fl 

/* 

8ft 

?A 

lflft 

11* 

12(5 

130 

14ft 

\ht 

160 

?P0 

21^ 

22ft 

23ft 



FR=HCJDU)*lftM5ft 

TnA-iraMwiraDUJ-iW+spsFH-raiDn^^i+siiCT-iMTtMiijaM.a: 

X=0:GG£Uli20fl 

DRAWl,X f Y: Yft=Y 

FURX= ] *TU 1(24 STE P20 

G0SUE2pji 
lPAB£(Y-¥()>&f»*THEH?l>aAWl r X,Y 

URAWlTDX r Y:Vft:Y 

NEXT 

FOHX=lT03fl|)fTNEXT 

tf = AM*S IN ( X/FH-l-AD) / tOfi < Tft* ( X/FR+iM)) ) i I fCT= 1 THEN ¥=- Y 

IFY> ip23THEK^*lft21i 
RKTUBN 



PROGRAM 2 



* REM J-D PYRAJlIC 
l(f <jHAPH1C2sCOT.0HQ p 7 p ] p )2 
29 FCR1=1TD5:READK{T) r Y(£) ,2 []] :NEXT 
f9 FCRI-]1'US 

VY[I}=YfI) 

KX(I)=X(I) 

EZfl) =Z(I) 

FUINT2,5flfl+(2#0*XXfm/(YY(r}<2»fr! P 5>«» 
NEXT£MC=0tYC=2 2J 
A=A+2f : R-A/^7. 29 
FOR1=JT05 

XX{T]=fX(l]-KC)*COS(R> + (Y:i)-tC)+HIW[R)HKC 
YYfI)-(^(i)-YC)*CCJH(R) + /X(l)-XC)*SIN{R)-hYt:+1^3 



IBS 

11 (f 
111 
12# 

n? 
led 

17* 
180 

i as 

1131 

195 
2** 
21* 
22fL 
221 
2?2 
223 
999 



MRXV 

SCNtLH 

FUHT=1T04 

nRAW2 # AX{^J P AY{5)TQAH(n pA*{1J 
NbitfT 

GRAW2 P AX( ]) r AY[L)T0AX(2) ,AY(2j 
DRAW?, AX ( 3 ) x AY ( 3 } TOAX ( 4 ) , A Y ( 4) 

qt1aw2,ak(:j) # ay(3)t0ax(u,ay(]} 
dhaw2, ax (2) ,ay ( 2} toax ( 4 ) ,ayh] 
uptoigp 



-300MSp(T 



DATA-2flfl r P» p igBp-2»ft,4?(pl9fl J 2(*,3»,iq( p 2B| J 42d p lSfl J *,22(f r -3fle 



PROGRAM 3 



ART ADAPTLH FKOh BYTE ARTICLE 



5 REM. GRAPHIC UEHO 

ft KEM KiMRTTC STRING 

50 GRAPEIIC2 

2 CrjLUR#p^,5p & 

3( E'ORL- i pTUbJ)0£TEE>44 

JJ ClJ^CLE2p511,S]lpLp^f-L 

50 NEXT 

55 GUSUH900 

6^ Q=RUD{ l)/2+. 25 

7fi FOflL=BTQ^#PETEE']? 

&f crRCLfZrblipSllxLpS^P-L'O 

^U NEXT 

1J10 GOSUbVfl* 

110 0=KHD( ] J/2+.2& 

]2tf t'UflL-.flTOSflPSTEPJJ! 

1J# ClBCr.E?!?]! ,5ll < L*Q r &M-l- 

H0 WEXT 

15* G0SOT9I* 

2?# FORL-0TU2**S?El J IT/2 5 

2±f ClHCLE2 r 51 J+4flfl*5IN<L) P S11 t-1frtf*CO±> fLl .79, Lflfl 

?4# NEXT 

vtjp FORL-pTL>2* TTPTEP3T/50 

2?P CIRCLES, 5"ll+JM*5'Jl[Lj P 5] j+4pH*COS (LJ/(T.+ lJ r 7 5-L* I f # l^P-L+ 1 3 

2GJ NEXT 

2 4 a COSUR9JB0 

?Sfl GRAPHIC 1 :Dl*lM{ If p p "i) =rtlJ<L-:T05 = r!C = 7WTfBHD(Jl +3) 

301 BO=THT\ r RWD(lJ*16) =TFDO=SCTHEMipi 

Ifl 2 CH-1NT i KWD ( 1 } *E1 J £ IF (CH^SC J OB ' CH=BO) THEU 3(2 

JB1 MI=TMT(BND( 11*16) ! 1 F fMJ=&C) OR (AU-RD* OR (ALJ=CH) THENJ#3 

304 COLUHatxAOp^UfAU 

310 X=THT{RND( ] }*lfl2<£} J V= THT (BND f 1 ) *1(24) : )CI =IHT ( RfcTD (1 ) * lp24 ) 

115 Y1-INT(RNE< J)*lff2fl) 

3 2* Ci=P=C2-» 
113P FDRM=(TC?p0 

J40 IFCKlTHENCl^+rNTfRBE^ 1) *10) : RE= IHT * ]*ND ( 1 ;■ * 3 ;■ +1 

35P IFC2<1TE[ENDX-INT[HN[J(1^*P1) -4B 1 EY-1 NT ( RKE { 1 ) *fl 1) -4P = DA -INT ( HNrt ( ] ; *R1) -40 

355 7FC2<lTblEMLlR=INT(BMD( 11 *Bl| ■ 4( = C? = 1 54 INT ( LiNE | 1) * lp?) 

360 J( = X+DX:Y-Y+C™i Xl-X 1 +DA: Yl -Yl p L>R 

361 IF(X<P1 GR(X> 102.1 JTblENDX- H* : K = H-*DX*2 

362 FF(V<i)ORmi02 3)THEWDY^-DY:Y-JfOY*F 
1fi:i IF(XKf)AR(Xl >1023rLHRNEri=-DA: Xl-Xl I JJ*"* 2 
3ftJ 1 P ( Yl<#) OH ( Yl > If2 2 ) TRBWDB=-DB1 Yl-al lUR* ? 
365 CI =Cl-l SC2-C2-] 

j?# IiKAWi p A%(Hp() p^HH,i;TOAt(Mp2l ,M(h,1) 

3&# CRAWKExXpYTDHl J YllAft[M r e)=K:A%^H r l)-YlA*fM p 2)=Kl : At (i1 # :i) -Yl 

J1 4 D W R XT : NE X T 

jpfl GDtiUb^fll 

S1*9 GRr.pHTCfliCOLCKlp^xep^iPniNT'HOrE YOU LIKED TH^ SHIWL" jmniTESM SHUN 

9PB FORD- lTD2P0 p 5 = HnHT:ECN<.LHf RETURN